import React from 'react';
import { View, Image, Text } from '@tarojs/components';
import './index.less';
//缺省空页面
interface CommonBlankProps {
  /** 是否显示 */
  visible: boolean;
  blank?: any;
  desc: string;
}

export default function CommonBlank({
  visible,
  blank,
  desc,
}: CommonBlankProps) {
  if (!visible) {
    return null;
  }

  return (
    <View
      className="page-blank"
      // style={{ paddingTop: `${store.commonStore.pageAreaTop}rpx` }}
    >
      <View className="blank-content">
        <Image
          src={
            blank ||
            'https://file.linkcook.cn/image/wineMiniProgram/exception/empty_search.png'
          }
        />
        <Text className="blank-desc">{desc}</Text>
      </View>
    </View>
  );
}
